<html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
    <title>产品反馈</title>
</head>
<body>
<div class="page-container">
    <div class="page-content">
        <div class="container">
            <!-- BEGIN PAGE CONTENT INNER -->
            <div class="portlet-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="portlet light">
                            <div class="portlet-title">
                                <div class="note note-success">
                                    <h4 class="block">您可以在这里将产品与服务的体检，反馈给我们</h4>
                                </div>
                            </div>
                            <div class="portlet-body form">
                                <!-- BEGIN FORM-->
                                <form id="form_sample_1" class="form-horizontal">
                                    <div class="form-body">
                                        <div class="form-group">
                                            <label  class="col-md-2 col-sm-2 col-xs-2 control-label">反馈主题： </label>
                                            <div class="col-md-10 col-sm-10 col-xs-10">
                                                <div class="input-icon right">
                                                    <input type="text" id="feedbackName" name="feedbackName"
                                                           class="input-xlarge form-control" validate="{required:true}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-body">
                                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                                    <div class="form-group">
                                                        <label class="col-md-2 control-label">反馈内容：</label>
                                                        <div class="col-md-8">
                                                            <textarea class="form-control" rows="8" id="feedbackInfo" name="feedbackInfo"></textarea>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                                <div class="form-actions right">
                                    <button  class="btn blue" onclick="doSubmit()"><i class="fa fa-check"></i>提交
                                    </button>
                                </div>
                                <!-- END FORM-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function doSubmit() {
        var feedbackName = $("#feedbackName").val();
        var feedbackInfo = $("#feedbackInfo").val();
        layer.open({
            content: '确定提交？',
            btn: ['确定', "取消"],
            shade: false,
            offset: '200px',
            yes: function (index, layero) {
                $.ajax({
                    type: "POST",
                    url: rootPath + "/feedbackCon/ajax/addFeedback",
                    data:{feedbackName:feedbackName,feedbackInfo:feedbackInfo},
                    dataType: "json",
                    success : function(data) {
                        if(data.code == '0000') {
                            layer.msg(data.msg, {icon: 1});
                        }else {
                            layer.msg(data.msg, {icon: 2});
                        }
                    },
                    error:function(){
                        layer.msg("操作出错！",{icon: 2});
                    }
                });
            },
            cancel: function (index) {
            }
        });
    }
</script>
</body>
<!-- END BODY -->
</html>